<?php
namespace App\Console\Commands; use Illuminate\Console\Command; class ResetPassword extends Command { protected $signature = 'reset:password {email} {password}'; protected $description = 'Reset the password of user
Usage: php artisan reset:password user@email.com'; public function __construct() { parent::__construct(); } public function handle() { $sp625552 = $this->argument('email'); if (!$sp625552) { $this->warn('please input the user\'s email
'); return false; } $spbfa519 = \App\User::where('email', $sp625552)->first(); if (!$spbfa519) { $this->warn("can't find the user: {$sp625552} \nplease input the user's email\n"); return false; } $sp02bf0b = $this->argument('password'); $spbfa519->password = bcrypt($sp02bf0b); $spbfa519->save(); $this->info("the password of '{$sp625552}' has been set to {$sp02bf0b}\n"); return true; } }